import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { equipmentFireGroupVO, equipmentFireGroupForm, equipmentFireGroupQuery } from '@/api/security/firefighting/fire-equipment-group/types';

// import { equipmentFireGroupVO, equipmentFireGroupForm, equipmentFireGroupQuery } from '@/api/equipment/equipment-fire-group/types';

/**
 * 查询消防点位列表
 * @param query
 * @returns {*}
 */

export const listcontrolpoint = (query?: controlpointQuery): AxiosPromise<controlpointVO[]> => {
  return request({
    url: '/fire/controlPoint/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询消防点位详细
 * @param fireControlPointId
 */
export const getcontrolpoint = (fireControlPointId: string | number): AxiosPromise<controlpointVO> => {
  return request({
    url: '/fire/controlPoint/' + fireControlPointId,
    method: 'get'
  });
};

/**
 * 新增消防点位
 * @param data
 */
export const addcontrolpoint = (data: controlpointForm) => {
  return request({
    url: '/fire/controlPoint',
    method: 'post',
    data: data
  });
};

/**
 * 修改消防点位
 * @param data
 */
export const updatecontrolpoint = (data: controlpointForm) => {
  return request({
    url: '/fire/controlPoint',
    method: 'put',
    data: data
  });
};

/**
 * 删除消防点位
 * @param fireControlPointId
 */
export const delcontrolpoint = (fireControlPointId: string | number | Array<string | number>) => {
  return request({
    url: '/fire/controlPoint/' + fireControlPointId,
    method: 'delete'
  });
};


/**
 * 查询摄像头列表
 */
export const listcamera =  (): AxiosPromise<CameraVo[]> => {
  return request({
    url: '/fire/controlPoint/listAllCamera',
    method: 'get'
  });
};


/**
 * 查询设备-消防分组列表
 * @param query
 * @returns {*}
 */

export const listequipmentFireGroup = (query?: equipmentFireGroupQuery): AxiosPromise<equipmentFireGroupVO[]> => {
  return request({
    url: '/equipment/equipment-fire-group/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询设备-消防分组详细
 * @param equipmentFireGroupId
 */
export const getequipmentFireGroup = (equipmentFireGroupId: string | number): AxiosPromise<equipmentFireGroupVO> => {
  return request({
    url: '/equipment/equipment-fire-group/' + equipmentFireGroupId,
    method: 'get'
  });
};

/**
 * 新增设备-消防分组
 * @param data
 */
export const addequipmentFireGroup = (data: equipmentFireGroupForm) => {
  return request({
    url: '/equipment/equipment-fire-group',
    method: 'post',
    data: data
  });
};

/**
 * 修改设备-消防分组
 * @param data
 */
export const updateequipmentFireGroup = (data: equipmentFireGroupForm) => {
  return request({
    url: '/equipment/equipment-fire-group',
    method: 'put',
    data: data
  });
};

/**
 * 删除设备-消防分组
 * @param equipmentFireGroupId
 */
export const delequipmentFireGroup = (equipmentFireGroupId: string | number | Array<string | number>) => {
  return request({
    url: '/equipment/equipment-fire-group/' + equipmentFireGroupId,
    method: 'delete'
  });
};

